package com.winter.Controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.winter.model.PersonalRelease;
import com.winter.service.PersonalReleaseService;
import com.winter.util.Result;
/**
 * 职场模块   高级人才
 * @author Administrator
 *
 */
@RestController
@RequestMapping("/personal")
public class PersonalReleaseController {

	@Autowired
	private PersonalReleaseService service;
	
	 /**
     * 查询职场 高级人才列表
     * @return
     */
	@GetMapping("/querypage")
	public Result queryPageList(Integer pageNumber,Integer pageSize, String worklife,String key,String userNo,Integer dcTime,String dcSalary){
		return service.queryPageList(pageNumber, pageSize, worklife, key, userNo,dcTime,dcSalary);
	}
	
	 /**
     * 查询职场 高级人才详情
     * @return
     */
	@GetMapping("/querybyid")
	public Result queryById(Long id,String userNo,String hirejob,String userType){
		return service.queryById(id,userNo,hirejob,userType);
	}
	
	/**
	 * 查询发布简历详情
	 * @return
	 */
	@GetMapping("/selectpublish")
	public Result queryPublishKey(Long id,String userNo){
		return service.selectByPrimaryKey(id, userNo);
	}
	
	/**
     * 选择简历
     * @return
     */
	@GetMapping("/querybykeyid")
	public Result querybykeyid(Long id,String userNo,String hirejob){
		return service.queryByKeyId(id,userNo,hirejob);
	}
	
	/**
	 * 发布简历
	 * @return
	 */
	/*@GetMapping("/insert")
	public Result insert(String title,String exprsalary, String showName,String sex,String worklife,String hukou,String custMobile,
			String custEmail,String politicalaffiliation,String homeAddr,String eduExpr,String workExpr,String selfDesc,
			String userEdu,String annualsalary,String jobstatus,String maritalstatus,Short height,String forte){
		    
		return null;
	}*/
	/**
	 * 发布简历
	 * @return
	 */
	@PostMapping("/insert")
	public Result insert(@RequestBody PersonalRelease record){
		return service.Insert(record);
	}
	
    /**
     * 根据简历id删除
     * @param id
     * @return
     */
    @DeleteMapping("/delete")
    public Result delete(Long id){
    	return service.delete(id);
    }
    
    /**
     * 根据简历id修改
     * @param id
     * @return
     */
    @PutMapping("/update")
    public Result update(@RequestBody PersonalRelease record){
    	return service.update(record);
    }
    
    /**
     * 查询发布简历列表
     * @return
     */
    @GetMapping("/querypublishlist")
    public Result querypublishlist(Integer pageNumber,Integer pageSize,String userNo){
    	return service.queryPublishList(pageNumber, pageSize, userNo);
    }
    
    /**
     * 聘请的人才列表
     * @return
     */
    @GetMapping("/queryemploylist")
    public Result queryEmployList(Integer pageNumber,Integer pageSize,String userNo){
    	return service.queryEmployList(pageNumber, pageSize, userNo);
    }
}
